#ifndef WORKSPACEFACTORY_H
#define WORKSPACEFACTORY_H
#include <cell.h>
#include <path.h>
#include <robot.h>
#include <workspace.h>
#include <iostream>

using namespace std;
class WorkspaceFactory
{
public:
    //max size of the matrix
    const static int maxN = 100;
    const static int maxM = 100;

    inline static WorkspaceFactory& Instance() {
        static WorkspaceFactory instance;
        return instance;
    }
    Cell*** cellMatrix;

    void addRobot(int id);
    void addCell(int x, int y);
    void clear() { robots.clear(); }
    std::list<Robot*> getRobots(){return robots;}
    void print();
    Workspace* createWorkspace();
    void createMatrix(int size);
    int size;

private:
    Workspace* ws;

    std::list<Robot*> robots;
    inline explicit WorkspaceFactory() {}
    inline ~WorkspaceFactory() {}
    inline explicit WorkspaceFactory(WorkspaceFactory const&) {}
    inline WorkspaceFactory& operator=(WorkspaceFactory const&) { return *this; }
};

#endif // WORKSPACEFACTORY_H
